package com.sky.mapper;

import com.sky.entity.SetmealDish;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {

    @ApiOperation(" 根据菜品id查询套餐id")
    List<Long> getSetmealIdsByDishIds(List<Long> ids);

    @ApiOperation("根据套餐id删除套餐菜品关系")
    @Delete("delete from setmeal_dish where setmeal_id =#{setmealId}")
    void deleteBySetmealId(Long id);

    @ApiOperation("新增套餐菜品关系")
    void insertSetmealDish(List<SetmealDish> setmealDishes);

    @ApiOperation("根据套餐id查询菜品id")
    @Select("select dish_id from setmeal_dish where setmeal_id = #{setmealId}")
    List<SetmealDish> getBySetmealId(Long id);
}
